package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.customer.entity.CmCustomerFirstLevel;
import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayDtl;
import com.jrx.anytxn.reporting.entity.ModifyCmInteCoLonInfo;
import com.jrx.anytxn.reporting.service.IXibService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ModifyLonInfoProcessor implements ItemProcessor<CmCustomerFirstLevel, CmInteCoLonRepayDtl> {

    @Autowired
    private IXibService xibService;

    private static Logger logger = LoggerFactory.getLogger(ModifyLonInfoProcessor.class);

    @Override
    public CmInteCoLonRepayDtl process(CmCustomerFirstLevel item) throws Exception {
        try {
            return xibService.modifyLoanInfo(item);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("ModifyLonInfoProcessor 出错了：{}", e.getMessage());
        }
        return null;
    }
}
